/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package descente;

/**
 *
 * @author Hippolyte
 */
public class Point {

    public float x;
    public float y;
    
    public String nom;

    public Point() {
    }
    
    
    

    public Point(float x, float y, String nom) {
        this.x = x;
        this.y = y;
        this.nom = nom;
        
        
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Point temp = new Point(this.x,this.y, this.nom);
        return temp;
    }
    
    public float distance (Point p){
        float distance = (float) Math.sqrt((p.x - this.x) * (p.x - this.x) 
                + (p.y - this.y) * (p.y - this.y));
//        System.out.println(this.nom + " -> " + p.nom + " = " + distance);
        return(distance);
    }
    
    
}
